<template>
  <div calss="container">
    <h3>set</h3>
    <div>{{ person }}</div>
    <div>{{ arr1 }}</div>
    <button @click="updateFun">修改数据</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      person: {
        name: "张三",
        age: 18,
        address: "地球村",
      },
      arr1: [1, 2, 3, 4, 5],
    };
  },
  // 计算属性不得含有特殊字符%……&*（）@
  computed: {},
  // 方法集合
  methods: {
    updateFun() {
      //   delete this.person.age;
      //   this.person.sex = "男";
      this.$set(this.arr1.splice(4, 1, 20));
    },
  },
  // 生命周期 - DOM元素渲染前调用
  created() {},
  // 生命周期 - DOM元素渲染后调用
  mounted() {},
  components: {},
};
</script>
<style lang='less' scoped>
</style>
